using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace InvestmentIntelligence.DbModel.Models.Mapping
{
    public class EconomicSectorMap : EntityTypeConfiguration<EconomicSector>
    {
        public EconomicSectorMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Description)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("EconomicSector", "MarketData");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.SectorId).HasColumnName("SectorId");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.ParentId).HasColumnName("ParentId");
        }
    }
}
